/*
Contains:
	item procs
*/

obj/item
	var
		//tooltip rows
		rows = 2

		//statistic-based variables
		ac_boost	=0
		stat_boost	=0
		restriction	=0
		affinity	=0

	proc
		equip_to(mob/equipper)
			if(!(loc == equipper)) return
			if(equipper.can_equip(src))
				add_bonuses(equipper)
				equipper << "You equipped [src]."
				suffix = "Equipped"
				overlays += new /obj/overlay/equipped
				return 1
			return 0

		unequip_from(mob/loser, notell)
			if(!notell)loser << "You unequipped [src]."
			suffix = null
			overlays = new/list()
			remove_bonuses(loser)

		drop(mob/dropper)
			if(is_equipped(dropper))
				unequip_from(dropper, 1)
			Move(dropper.loc)

		is_equipped(mob/person)

		//TODO: all the other bonuses
		add_bonuses(mob/lucky)
			lucky.ac += ac_boost

		remove_bonuses(mob/failed)
			failed.ac -= ac_boost

	MouseDrag(over_object,src_location,over_location,src_control,over_control,params)
		usr.client.mouse_pointer_icon = icon(icon, icon_state)

	MouseDrop(over_object,src_location,over_location,src_control,over_control,params)
		usr.client.mouse_pointer_icon = null
		if(over_control == "default.map")
			drop(usr)

	HasMouseEntered(client/c,location,control,params)

		if(!(loc == c.mob))return

		var
			_oldx = c.mouse_x
			_oldy = c.mouse_y

		//wait a bit before comparing it again
		sleep(TOOLTIP_DELAY)

		c.update_mouse()
		if(in_range(c.mouse_x, _oldx) && in_range(c.mouse_y, _oldy))
			tooltip(c, "[++c.uid]", "[name]<br />[desc]", 256, 24*rows, c.mouse_x, c.mouse_y, 30, TRUE)